<?php
/**
*
* @author sunjing@shopex.cn
* @version 
*/
class erpapi_shop_response_plugins_order_giftreplace extends erpapi_shop_response_plugins_order_abstract
{

    public function convert(erpapi_shop_response_abstract $platform)
    {
        $gift = array();

        $gift['shop_id'] = $platform->__channelObj->channel['shop_id'];

      return $gift;
    }

    /**
     *
     * @return void
     * @author 
     **/
    public function postCreate($order_id,$gift)
    {

        if ($order_id){
            $bn_data = kernel::single('ome_order_giftreplace')->check($order_id,$gift['shop_id']);

            if ($bn_data){
                $order_bool_type = ome_order_bool_type::__GIFT_CODE;
                kernel::single('ome_order_giftreplace')->edit($order_id,$bn_data);
                app::get('ome')->model('orders')->update(array('order_bool_type'=>$order_bool_type), array('order_id'=>$order_id));
            }
        }
        
      
    }
}